<HTML><HEAD><TITLE>cd(+Directory)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Operating System</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>cd(+Directory)</H1>
Directory is made the current working directory.  Equivalent to
set_flag(cwd, Directory).


<DL>
<DT><EM>Directory</EM></DT>
<DD>Atom or string of any form acceptable to the operating                system.
</DD>
</DL>
<H2>Description</H2>
   Changes the current working directory to Directory.  Directory may be an
   absolute or relative pathname.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>cd(+) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Directory is not instantiated.
<DT><EM>(5) type error </EM>
<DD>Directory is neither an atom nor a string.
<DT><EM>(170) system interface error </EM>
<DD>Directory doesn't exist.
</DL>
<H2>Examples</H2>
<PRE>
Success:
      cd(workdir).
      cd("workdir").
      cd('/home/lp/user/workdir').
      cd('..').
      cd('../workdir').

Error:
      cd(Dir).                    (Error 4).
      cd(20).                     (Error 5).
      cd('nonexist').             (Error 170).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/opsys/getcwd-1.html">getcwd / 1</A>, <A HREF="../../kernel/env/set_flag-2.html">set_flag / 2</A>
</BODY></HTML>
